package com.example.demo.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

@Configuration
public class AppConfig {

    @Value("${white-list}")
    private List<String> whiteList;

    @Bean
    public Set<String> whiteListSet() {
        return whiteList.stream()
                        .map(String::trim)
                        .collect(Collectors.toSet());
    }
}
